<?php


/**
 * Default controller class.
 */
class Ajax_Controller{

	/**
	 * Sum
	 */
	function countmessages_action(){

		check_login();
		
		$private_messages = new Private_Messages();
		$result = $private_messages->count_unread();
		
		$message_view = new Messages_View();
		$message_view->new_messages_ajax($result);
		
		$main_view = new Main_View();
		$main_view->generate_html();
	}
	
	function onlineuser_action(){
	
		check_login();
	
		$private_messages = new Private_Messages();
		$result = $private_messages->count_online_user();
	
		$message_view = new Messages_View();
		$message_view->online_user_ajax($result);
	
		$main_view = new Main_View();
		$main_view->generate_html();
	}
	
	
	
	
}
